C1.LiveLinq.AdoNet Namespace > IndexedDataTable<TRow> Class : BeginUpdate Method |
This method must be followed by EndUpdate.
Use this method when you already have indexes built over a data table or live views based on that data table, and you need to re-populate it or perform other massive changes to rows of that data table. Without this method, every single change you make causes LiveLinq to perform necessary operations for maintaining your indexes and live views dependent on this data table. In case of massive changes, this can be slower than to wait until the massive changes are done and rebuild the indexes and live views.
Between BeginUpdate and EndUpdate calls, indexes, live views, bound controls and other change notification listeners are not updated, they don't receive change notifications.
When EndUpdate is called, a SourceChangeType.Modify or SourceChangeType.Reset notification is sent, depending on whether the change affected a single row or multiple rows of the data table. Even when you change a single row, it may make sense to enclose your changes in BeginUpdate/EndUpdate if you change multiple fields in the row. In that case a SourceChangeType.Modify notification is sent. If more than one row was changed, a SourceChangeType.Reset notification is sent, meaning all indexes, live views and other collections dependent on this data table must be rebuilt from scratch.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2